[mirrors]
http://www.thrysoee.dk/editline/libedit-20121213-3.0.tar.gz

[vars]
filesize=473665
sha512=06420df987429bdec6aea216046548cb7d1e1ed004e140c01692625dfb9149cc42ad98755a467c8b26734caff19284cb581bf64d58e49f683445ea01625d146b

[deps]
termcap

[build]
patch -p1 < "$K"/libedit_readlineh.patch

[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine)"

CFLAGS="-D_GNU_SOURCE -D_BSD_SOURCE -D__STDC_ISO_10646__ $optcflags" \
  ./configure -C --prefix="$butch_prefix" --enable-widec $xconfflags
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

# use libedit as a readline drop-in replacement (it has 10 KLOC less, 20 instead of 30)
dest="$butch_install_dir""$butch_prefix"
ln -sf libedit.a "$dest"/lib/libreadline.a
ln -sf libedit.so "$dest"/lib/libreadline.so
mkdir -p "$dest"/include/readline
touch "$dest"/include/readline/history.h
touch "$dest"/include/readline/tilde.h
ln -sf ../editline/readline.h "$dest"/include/readline/readline.h
